package com.jsb.laundry.service.impl;

import com.jsb.laundry.dao.RealNameAuthenticationDao;
import com.jsb.laundry.model.dto.ConductCertificationRequest;
import com.jsb.laundry.service.RealNameAuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RealNameAuthenticationServiceImpl implements RealNameAuthenticationService {
    @Autowired
    private RealNameAuthenticationDao realNameAuthenticationDao;

    /**
     * 查询用户id
     *
     * @param userId
     * @return
     */
    @Override
    public String findByUserId(String userId) {
        return realNameAuthenticationDao.findByUserId(userId);
    }

    /**
     * 进行实名认证
     *
     * @param conductCertificationRequest
     * @return
     */
    @Override
    public int conductCertification(ConductCertificationRequest conductCertificationRequest) {
        return realNameAuthenticationDao.conductCertification(conductCertificationRequest);
    }

    /**
     * 更新状态
     *
     * @param userId
     * @param authStatus
     * @param resultMsg
     * @return
     */
    @Override
    public int updUserInfoRealNameAuthStatus(String userId, String authStatus, String resultMsg) {
        return realNameAuthenticationDao.updUserInfoRealNameAuthStatus(userId,authStatus,resultMsg);
    }
}
